home *** CD-ROM | disk | FTP | other *** search
- Subject: v12i050: A PostScript(tm) interpreter, Part01/18
- Newsgroups: comp.sources.unix
- Sender: sources
- Approved: rs@uunet.UU.NET
-
- Submitted-by: Crispin Goswell <caag@vd.rl.ac.uk>
- Posting-number: Volume 12, Issue 50
- Archive-name: postscript/part01
-
- This is a virtually complete implementation of PostScript. Just type
- make and it should produce a version for suns. Since the only complete
- driver is for suns and since some driver writing will be necessary on
- any other machine, I have not packaged everything up in an idiot-proof
- box. I am not aware of any Gotchas in building this source. The X
- driver used to work on X10 - It will need work for X11. The pixrect
- driver is very new, and should be regarded as didactic, as it scribbles
- straight onto the display. Persuading suntools to look after the bits
- would have taken too long.
-
- Writing your own driver involves merely hacking pixrect.c until it will
- drive your display. There are only 11 routines to write, and they're
- all quite short.
-
- Have fun!
-
- - Crispin Goswell
-
- caag@uk.ac.rl.vd (JANET)
- caag@vd.rl.ac.uk (Internet)
- ...!mcvax!ukc!rlvd!caag (UUCP)
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 18)."
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'INSTALLATION' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'INSTALLATION'\"
- else
- echo shar: Extracting \"'INSTALLATION'\" \(1880 characters\)
- sed "s/^X//" >'INSTALLATION' <<'END_OF_FILE'
- X
- XNote that is necessary to run a shell with job-control (e.g. csh) on
- Xthe sun3 version when using PS, because of process-group problems with
- Xsuntools. It is also difficult to alter the window shape when PS is
- Xdoing output on suns. If the postscript/viewer pair are used, these
- Xproblems are not encountered, but it runs more slowly.
- X
- XTo try it out, type the following:
- X $ POSTSCRIPTLIB=<where ever the postscript directory is>/postscript
- X $ export POSTSCRIPTLIB
- X $ PS -c 'A4 (demos/wow) lib run'
- X $
- X
- XThe "showpage" operator expects a carriage return before it erases the
- Xpage and allows output to continue (or in this case for PS to
- Xterminate). More generally, use:
- X
- X $ PS -c A4 [ files .... ]
- X $
- X
- XThe A4 command is shorthand for a framedevice command (see the
- Xpostscript reference manual) to create an A4 sized window. It is
- Xsupposed to be actual size, except on suns, where the screen is not big
- Xenough (!)
- X
- XIt also works on the perq, but much more slowly.
- X
- XIf PostScript is not to be fully installed, the environment variable
- XPOSTSCRIPTLIB may be set to the pathname of /usr/lib/postscript.
- XAlternatively, config.c has a variable called default_library[], which
- Xmay be changed to point somewhere else.
- X
- XThe tape contains:
- X
- XINSTALLATION which you are reading
- X
- Xsource - complete sources
- X
- Xpostscript - various files the interpreter needs to run.
- X /font - font descriptors
- X /fonts - font data
- X hershey fonts (yuk) all we have available at present,
- X however there are instructions on how to add fonts in
- X the file "adding-fonts".
- X /psrc - initialisation file ('rc' file).
- X /cache - disk cache of popular font sizes
- X /font-map - mapping from postscript names to names in font
- X /demos - demos programs other than those in the cookbook
- X
- Xdoc - documents of interest to people installing postscript, particularly
- X postscript.1 - manual entry for postscript
- END_OF_FILE
- if test 1880 -ne `wc -c <'INSTALLATION'`; then
- echo shar: \"'INSTALLATION'\" unpacked with wrong size!
- fi
- # end of 'INSTALLATION'
- fi
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(4640 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Archive # Description
- X-----------------------------------------------------------
- X INSTALLATION 1
- X MANIFEST 1
- X binaries 1
- X binaries/pnx5 1
- X binaries/pyramid 1
- X binaries/sun2 1
- X binaries/sun3 1
- X binaries/vax 1
- X doc 1
- X doc/adding-fonts 1
- X doc/byte-stream 2
- X doc/hard-interface 5
- X doc/hard-interface.c 7
- X doc/postscript.1 3
- X postscript 1
- X postscript/demos 1
- X postscript/demos/dashcorner 1
- X postscript/demos/fishes 5
- X postscript/demos/gks 1
- X postscript/demos/grayscale 1
- X postscript/demos/hughes 1
- X postscript/demos/it 1
- X postscript/demos/mooreform.ps 3
- X postscript/demos/newscreen.ps 1
- X postscript/demos/raygun2 18
- X postscript/demos/rosette 1
- X postscript/demos/tree.ps 1
- X postscript/demos/wow 1
- X postscript/demos/wow2 1
- X postscript/demos/wow3 1
- X postscript/font 1
- X postscript/font-map 1
- X postscript/font/Helvetica 1
- X postscript/font/Helvetica-Ob 1
- X postscript/font/Times-BI 1
- X postscript/font/Times-Bold 1
- X postscript/font/Times-Italic 1
- X postscript/font/Times-Roman 1
- X postscript/font/Times-Roman-Adobe 1
- X postscript/font/proforma 1
- X postscript/fonts 1
- X postscript/fonts/Gothic 1
- X postscript/fonts/Gothic/roman.r10
- X postscript/fonts/Olde 1
- X postscript/fonts/Olde/italic.r14
- X postscript/fonts/Olde/roman.r16
- X postscript/fonts/SANS 1
- X postscript/fonts/SANS/italic.r13
- X postscript/fonts/SANS/roman.r13
- X postscript/fonts/Sans 1
- X postscript/fonts/Sans/greek.r 3
- X postscript/fonts/Sans/italic.r 7
- X postscript/fonts/Sans/roman.r17
- X postscript/fonts/TIMES 1
- X postscript/fonts/TIMES/italic.r15
- X postscript/fonts/TIMES/roman.r15
- X postscript/fonts/Times 1
- X postscript/fonts/Times/bits.r11
- X postscript/fonts/Times/greek.r 6
- X postscript/fonts/Times/italic 1
- X postscript/fonts/Times/italic.a 5
- X postscript/fonts/Times/italic.r 8
- X postscript/fonts/Times/rest.r 4
- X postscript/fonts/Times/roman 1
- X postscript/fonts/Times/roman.a 5
- X postscript/fonts/Times/roman.r 6
- X postscript/fonts/Times/russian.r 9
- X postscript/fonts/extra 1
- X postscript/fonts/extra/extra.r11
- X postscript/fonts/sans 1
- X postscript/fonts/sans/greek.r 1
- X postscript/fonts/sans/roman.r 3
- X postscript/fonts/times 1
- X postscript/fonts/times/greek.r 5
- X postscript/fonts/times/italic.r 7
- X postscript/fonts/times/roman.r16
- X postscript/psrc 10
- X postscript/widths 1
- X postscript/widths/Adobe 1
- X postscript/widths/Adobe/Times-Roman 3
- X source 1
- X source/README 1
- X source/X.c 12
- X source/adapter.c 4
- X source/array.c 7
- X source/boolean.c 2
- X source/cache.c 12
- X source/canon.c 1
- X source/canon.h 1
- X source/colour-ww.c 6
- X source/colour.c 2
- X source/colour.h 1
- X source/config.c 2
- X source/control.c 4
- X source/copyright.h 1
- X source/device.c 5
- X source/device.h 1
- X source/dictionary.c 10
- X source/file.c 14
- X source/fill.c 12
- X source/font.c 13
- X source/font.h 1
- X source/graphics.h 1
- X source/gsave.c 2
- X source/hard-interface.c 8
- X source/hard.h 1
- X source/head 1
- X source/head.ed 1
- X source/image.c 9
- X source/integer.c 6
- X source/main.c 8
- X source/main.h 2
- X source/makefile 1
- X source/malloc.c 1
- X source/mat.c 2
- X source/mat.h 1
- X source/math.c 3
- X source/matrix.c 8
- X source/misc.c 1
- X source/name.c 2
- X source/null.c 1
- X source/operator.c 6
- X source/orion.c 4
- X source/paint.c 3
- X source/pat.c 10
- X source/path.c 8
- X source/path.h 1
- X source/pixrect.c 3
- X source/point.h 1
- X source/poly.c 2
- X source/property.c 2
- X source/protocol.c 2
- X source/protocol.h 1
- X source/real.c 4
- X source/rop.h 1
- X source/save.c 1
- X source/screen.c 2
- X source/stack.c 4
- X source/state.c 9
- X source/str.h 1
- X source/string.c 11
- X source/stroke.c 9
- X source/trapezoid.c 1
- X source/unix.c 2
- X source/viewer.c 7
- X source/ww.c 4
- END_OF_FILE
- if test 4640 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test ! -d 'binaries' ; then
- echo shar: Creating directory \"'binaries'\"
- mkdir 'binaries'
- fi
- if test ! -d 'binaries/pnx5' ; then
- echo shar: Creating directory \"'binaries/pnx5'\"
- mkdir 'binaries/pnx5'
- fi
- if test ! -d 'binaries/pyramid' ; then
- echo shar: Creating directory \"'binaries/pyramid'\"
- mkdir 'binaries/pyramid'
- fi
- if test ! -d 'binaries/sun2' ; then
- echo shar: Creating directory \"'binaries/sun2'\"
- mkdir 'binaries/sun2'
- fi
- if test ! -d 'binaries/sun3' ; then
- echo shar: Creating directory \"'binaries/sun3'\"
- mkdir 'binaries/sun3'
- fi
- if test ! -d 'binaries/vax' ; then
- echo shar: Creating directory \"'binaries/vax'\"
- mkdir 'binaries/vax'
- fi
- if test ! -d 'doc' ; then
- echo shar: Creating directory \"'doc'\"
- mkdir 'doc'
- fi
- if test -f 'doc/adding-fonts' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/adding-fonts'\"
- else
- echo shar: Extracting \"'doc/adding-fonts'\" \(1849 characters\)
- sed "s/^X//" >'doc/adding-fonts' <<'END_OF_FILE'
- XFonts may be added to this postscript system by placing a piece of
- XPostScript source in the directory $POSTSCRIPTLIB/font. This is where
- Xpostscript looks when findfont is called. File names in this directory
- Xmay be mapped from font names by placing entries of the form:
- X FontMap /postscript-name /base-file-name. put
- Xin the font-map file in $POSTSCRIPTLIB.
- X
- XIf postscript-name is not found there, an identity mapping is assumed.
- X
- XThe existing fonts are similarly structured, so most of the work is
- Xdone by executing a common proforma file in that directory. This sets
- Xup the appropriate font information. A version of BuildChar is
- Xinstalled which will read in the bulk of the font infromation when it
- Xis first executed. It will then replace itself with the normal
- XBuildChar.
- X
- XNOTE the metrics are currently loaded with the rest of the font
- Xinformation on demand, so programs which attempt to read metric
- Xinfromation before using a font will fail. This is a bug, but can be
- Xfixed in PostScript.
- X
- XThere is a parallel cache directory, $POSTSCRIPTLIB/cache. This
- Xcontains a directory corresponding to each file in $POSTSCRIPT/font,
- Xinto which cached versions of fonts may be placed. The operator
- Xsavecurrentfont may be called after imaging some characters from a
- Xfont, whereupon a diskcache will be made of the characters imaged so
- Xfar. Caches loaded may be subsequently modified and saved, thus built
- Xincrementally. There should be an operator to save all modified caches
- Xinto the disk cache. This could be built into PostScript, but might
- Xcause problems. There is a program called buildcache in the demos
- Xdirectory which will build a cache of the standard fonts in a variety
- Xof useful sizes.
- X
- XPostScript searches the disk cache automatically, and will not call BuildChar if it find a cache.
- XThis version of the cache stores metrics for the font.
- X
- END_OF_FILE
- if test 1849 -ne `wc -c <'doc/adding-fonts'`; then
- echo shar: \"'doc/adding-fonts'\" unpacked with wrong size!
- fi
- # end of 'doc/adding-fonts'
- fi
- if test ! -d 'postscript' ; then
- echo shar: Creating directory \"'postscript'\"
- mkdir 'postscript'
- fi
- if test ! -d 'postscript/demos' ; then
- echo shar: Creating directory \"'postscript/demos'\"
- mkdir 'postscript/demos'
- fi
- if test -f 'postscript/demos/dashcorner' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/dashcorner'\"
- else
- echo shar: Extracting \"'postscript/demos/dashcorner'\" \(120 characters\)
- sed "s/^X//" >'postscript/demos/dashcorner' <<'END_OF_FILE'
- X[10 90] 5 setdash 30 setlinewidth
- Xnewpath 0 0 moveto 100 0 lineto 100 100 lineto 0 100 lineto closepath stroke
- Xshowpage
- END_OF_FILE
- if test 120 -ne `wc -c <'postscript/demos/dashcorner'`; then
- echo shar: \"'postscript/demos/dashcorner'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/dashcorner'
- fi
- if test -f 'postscript/demos/gks' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/gks'\"
- else
- echo shar: Extracting \"'postscript/demos/gks'\" \(629 characters\)
- sed "s/^X//" >'postscript/demos/gks' <<'END_OF_FILE'
- X%!
- Xsave
- X100 setflat
- X/Courier findfont 400 scalefont setfont
- X
- X300 0 translate 90 rotate
- X
- X/track { dup
- X 0 0 moveto false charpath 30 setlinewidth strokepath
- X 0 setgray 5 setlinewidth stroke
- X 0 0 moveto false charpath 30 setlinewidth strokepath
- X .3 setgray 2.5 setlinewidth stroke
- X} def
- X
- X6 array currentmatrix
- X
- X(G) track (G) stringwidth translate
- X(K) track (K) stringwidth translate
- X(S) track (S) stringwidth translate
- X
- Xsetmatrix
- X
- X/rude (Eat your heart out!) def
- X
- X/Times-Roman findfont 100 scalefont setfont
- X
- X.3 setgray
- X
- Xclippath pathbbox pop exch pop exch sub rude stringwidth pop sub 2 div -150 moveto rude show
- X
- Xshowpage
- Xrestore
- END_OF_FILE
- if test 629 -ne `wc -c <'postscript/demos/gks'`; then
- echo shar: \"'postscript/demos/gks'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/gks'
- fi
- if test -f 'postscript/demos/grayscale' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/grayscale'\"
- else
- echo shar: Extracting \"'postscript/demos/grayscale'\" \(255 characters\)
- sed "s/^X//" >'postscript/demos/grayscale' <<'END_OF_FILE'
- Xinitgraphics
- Xclippath pathbbox pop exch pop 2 copy exch sub /range exch def
- X/step range 50.0 div def
- X0 200 translate
- Xnewpath
- Xstep exch {
- X dup range div setgray
- X 0 0 moveto step 0 lineto step 100 lineto 0 100 lineto closepath
- X fill
- X step 0 translate
- X} for
- END_OF_FILE
- if test 255 -ne `wc -c <'postscript/demos/grayscale'`; then
- echo shar: \"'postscript/demos/grayscale'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/grayscale'
- fi
- if test -f 'postscript/demos/hughes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/hughes'\"
- else
- echo shar: Extracting \"'postscript/demos/hughes'\" \(1300 characters\)
- sed "s/^X//" >'postscript/demos/hughes' <<'END_OF_FILE'
- X%!
- X70 9.3 72 mul translate
- X
- X/basic 18 def
- X
- X/large /Times-Roman findfont basic 2 mul scalefont def
- X/normal /Times-Roman findfont basic scalefont def
- X/italic /Times-Italic findfont basic scalefont def
- X
- X/down { 0 basic neg rmoveto } def
- X
- X/p { normal setfont show } def
- X/i { italic setfont show } def
- X/d { italic setfont 72 0 rmoveto (Death.) show } def
- X/n { currentpoint exch pop 0 exch moveto down } def
- X
- X0 0 moveto
- Xdown down down
- X
- X(Examination at the Womb-Door) large setfont show down n
- X
- X(Who owns these scrawny little feet?) p d n
- X(Who owns this bristly scorched-looking face?) p d n
- X(Who owns these still-working lungs?) p d n
- X(Who owns this utility coat of muscles?) p d n
- X(Who owns these unspeakable guts?) p d n
- X(Who owns these questionable brains?) p d n
- X(All this messy blood?) p d n
- X(These minimum-efficiency eyes?) p d n
- X(This wicked little tongue?) p d n
- X(This occasional wakefulness?) p d n
- X n
- X(Given, stolen or held pending trial?) p n
- X(Held.) i n
- X n
- X(Who owns the whole rainy, stony earth?) p d n
- X(Who owns all of space?) p d n
- Xn
- X(Who is stronger than hope?) p d n
- X(Who is stronger than the will?) p d n
- X(Stronger than love?) p d n
- X(Stronger than life?) p d n
- Xn
- X/but (But who is stronger than death?) def but p n
- Xbut stringwidth rmoveto (Me, evidently.) i n
- Xn
- X(Pass, Crow.) p n
- Xshowpage
- END_OF_FILE
- if test 1300 -ne `wc -c <'postscript/demos/hughes'`; then
- echo shar: \"'postscript/demos/hughes'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/hughes'
- fi
- if test -f 'postscript/demos/it' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/it'\"
- else
- echo shar: Extracting \"'postscript/demos/it'\" \(319 characters\)
- sed "s/^X//" >'postscript/demos/it' <<'END_OF_FILE'
- X%!
- X300 300 translate 0 setgray
- X12 {
- X 0 0 moveto 200 0 rlineto 0 200 rlineto -200 0 rlineto closepath
- X 25 25 moveto 0 150 rlineto 150 0 rlineto 0 -150 rlineto closepath
- X 125 100 moveto 100 100 25 0 360 arc closepath
- X gsave fill grestore
- X currentgray
- X 0 setgray stroke
- X 1 12 div add setgray
- X 30 rotate
- X} repeat
- Xshowpage
- END_OF_FILE
- if test 319 -ne `wc -c <'postscript/demos/it'`; then
- echo shar: \"'postscript/demos/it'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/it'
- fi
- if test -f 'postscript/demos/newscreen.ps' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/newscreen.ps'\"
- else
- echo shar: Extracting \"'postscript/demos/newscreen.ps'\" \(319 characters\)
- sed "s/^X//" >'postscript/demos/newscreen.ps' <<'END_OF_FILE'
- X%!
- X
- X/scr [ [43 11 35 3 41 9 33 1] [27 59 19 51 25 57 17 49] [39 7 47 15 37 5 45 13] [23 55 31 63 21 53 29 61] [42 10 34 2 44 12 36 4] [26 58 18 50 28 60 20 52] [38 6 46 14 40 8 48 16] [22 54 30 62 24 56 32 64] ]def
- X
- X82 8 idiv 0.0 { 1 add 4 mul cvi exch 1 add 4 mul cvi scr exch get exch get 33.0 sub 32 div } setscreen
- END_OF_FILE
- if test 319 -ne `wc -c <'postscript/demos/newscreen.ps'`; then
- echo shar: \"'postscript/demos/newscreen.ps'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/newscreen.ps'
- fi
- if test -f 'postscript/demos/rosette' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/rosette'\"
- else
- echo shar: Extracting \"'postscript/demos/rosette'\" \(436 characters\)
- sed "s/^X//" >'postscript/demos/rosette' <<'END_OF_FILE'
- X/inch {72 mul} def
- X
- X/wedge {
- X newpath 0 0 moveto 1 0 translate 15 rotate 0 15 sin translate
- X 0 0 15 sin -90 90 arc closepath
- X} def
- X
- Xgsave
- X 3.75 inch 7.25 inch translate
- X 1 inch 1 inch scale
- X wedge .02 setlinewidth stroke
- Xgrestore
- X
- Xgsave
- X 4.25 inch 4.25 inch translate
- X 1.75 inch 1.75 inch scale
- X .02 setlinewidth
- X 2 1 13 {
- X 13 div setgray
- X gsave
- X wedge gsave fill grestore
- X 0 setgray stroke
- X grestore
- X 30 rotate
- X } for
- Xgrestore
- END_OF_FILE
- if test 436 -ne `wc -c <'postscript/demos/rosette'`; then
- echo shar: \"'postscript/demos/rosette'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/rosette'
- fi
- if test -f 'postscript/demos/tree.ps' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/tree.ps'\"
- else
- echo shar: Extracting \"'postscript/demos/tree.ps'\" \(594 characters\)
- sed "s/^X//" >'postscript/demos/tree.ps' <<'END_OF_FILE'
- X%!
- X
- X/Times-Roman findfont setfont
- X
- X%/go { translate 0 0 moveto } def
- X/size 0 4 dtransform dup mul exch dup mul add def
- X
- X/tree {
- X 0 0 moveto (T) show
- X 0 1 dtransform
- X dup mul exch dup mul add
- X size gt
- X {
- X currentpoint translate
- X 0 .1 translate 0.6 0.6 scale
- X 0 0 moveto (R) show
- X currentpoint translate
- X .75 0 translate
- X gsave
- X 90 rotate tree
- X grestore
- X .75 0 translate
- X 90 rotate -1 1 scale
- X (T) stringwidth neg exch neg exch translate
- X tree
- X } if
- X } def
- X
- X100 400 translate 200 200 scale
- X
- Xtree
- Xshowpage
- X
- END_OF_FILE
- if test 594 -ne `wc -c <'postscript/demos/tree.ps'`; then
- echo shar: \"'postscript/demos/tree.ps'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/tree.ps'
- fi
- if test -f 'postscript/demos/wow' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/wow'\"
- else
- echo shar: Extracting \"'postscript/demos/wow'\" \(262 characters\)
- sed "s/^X//" >'postscript/demos/wow' <<'END_OF_FILE'
- X%!
- X.01 setlinewidth
- Xclippath pathbbox newpath
- X
- X3 -1 roll sub 2 div 3 1 roll exch sub 2 div exch
- X2 copy translate
- X2 copy gt {exch} if pop dup scale
- X90 rotate
- X25 { 0 .9 moveto 0 0 1 90 -90 arc
- X 0 0 .9 -90 90 arcn fill
- X .88 .88 scale 22.5 rotate } repeat
- X
- Xshowpage
- END_OF_FILE
- if test 262 -ne `wc -c <'postscript/demos/wow'`; then
- echo shar: \"'postscript/demos/wow'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/wow'
- fi
- if test -f 'postscript/demos/wow2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/wow2'\"
- else
- echo shar: Extracting \"'postscript/demos/wow2'\" \(320 characters\)
- sed "s/^X//" >'postscript/demos/wow2' <<'END_OF_FILE'
- X%!
- X.01 setlinewidth
- Xclippath pathbbox newpath
- X
- X3 -1 roll sub 2 div 3 1 roll exch sub 2 div exch
- X2 copy translate
- X2 copy gt {exch} if pop dup scale
- X90 rotate
- X/shade 0 def
- X25 {
- X shade setgray /shade 1 25 div shade add def
- X 0 .9 moveto 0 0 1 90 -90 arc
- X 0 0 .9 -90 90 arcn fill
- X .88 .88 scale 22.5 rotate } repeat
- Xshowpage
- END_OF_FILE
- if test 320 -ne `wc -c <'postscript/demos/wow2'`; then
- echo shar: \"'postscript/demos/wow2'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/wow2'
- fi
- if test -f 'postscript/demos/wow3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/demos/wow3'\"
- else
- echo shar: Extracting \"'postscript/demos/wow3'\" \(348 characters\)
- sed "s/^X//" >'postscript/demos/wow3' <<'END_OF_FILE'
- X%!
- X.01 setlinewidth
- Xclippath pathbbox newpath
- X
- X/big 1.0 31 { 2 mul } repeat def
- X
- X3 -1 roll sub 2 div 3 1 roll exch sub 2 div exch
- X2 copy translate
- X2 copy gt {exch} if pop dup scale
- X90 rotate
- X25 {
- X rand big div rand big div rand big div setrgbcolor
- X 0 .9 moveto 0 0 1 90 -90 arc
- X 0 0 .9 -90 90 arcn fill
- X .88 .88 scale 22.5 rotate } repeat
- Xshowpage
- END_OF_FILE
- if test 348 -ne `wc -c <'postscript/demos/wow3'`; then
- echo shar: \"'postscript/demos/wow3'\" unpacked with wrong size!
- fi
- # end of 'postscript/demos/wow3'
- fi
- if test ! -d 'postscript/font' ; then
- echo shar: Creating directory \"'postscript/font'\"
- mkdir 'postscript/font'
- fi
- if test -f 'postscript/font-map' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font-map'\"
- else
- echo shar: Extracting \"'postscript/font-map'\" \(277 characters\)
- sed "s/^X//" >'postscript/font-map' <<'END_OF_FILE'
- XFontMap /Times-BoldItalic /Times-BI put
- XFontMap /Helvetica-Oblique /Helvetica-Ob put
- XFontMap /Helvetica-Bold /Times-Roman put
- XFontMap /Symbol /Times-Roman put
- XFontMap /Courier /Helvetica put
- XFontMap /Courier-Oblique /Helvetica-Oblique put
- XFontMap /Courier-Bold /Times-Bold put
- END_OF_FILE
- if test 277 -ne `wc -c <'postscript/font-map'`; then
- echo shar: \"'postscript/font-map'\" unpacked with wrong size!
- fi
- # end of 'postscript/font-map'
- fi
- if test -f 'postscript/font/Helvetica' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Helvetica'\"
- else
- echo shar: Extracting \"'postscript/font/Helvetica'\" \(60 characters\)
- sed "s/^X//" >'postscript/font/Helvetica' <<'END_OF_FILE'
- X/Helvetica (fonts/SANS/roman.r) lib (font/proforma) lib run
- END_OF_FILE
- if test 60 -ne `wc -c <'postscript/font/Helvetica'`; then
- echo shar: \"'postscript/font/Helvetica'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Helvetica'
- fi
- if test -f 'postscript/font/Helvetica-Ob' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Helvetica-Ob'\"
- else
- echo shar: Extracting \"'postscript/font/Helvetica-Ob'\" \(64 characters\)
- sed "s/^X//" >'postscript/font/Helvetica-Ob' <<'END_OF_FILE'
- X/Helvetica-Ob (fonts/SANS/italic.r) lib (font/proforma) lib run
- END_OF_FILE
- if test 64 -ne `wc -c <'postscript/font/Helvetica-Ob'`; then
- echo shar: \"'postscript/font/Helvetica-Ob'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Helvetica-Ob'
- fi
- if test -f 'postscript/font/Times-BI' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Times-BI'\"
- else
- echo shar: Extracting \"'postscript/font/Times-BI'\" \(61 characters\)
- sed "s/^X//" >'postscript/font/Times-BI' <<'END_OF_FILE'
- X/Times-BI (fonts/TIMES/italic.r) lib (font/proforma) lib run
- END_OF_FILE
- if test 61 -ne `wc -c <'postscript/font/Times-BI'`; then
- echo shar: \"'postscript/font/Times-BI'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Times-BI'
- fi
- if test -f 'postscript/font/Times-Bold' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Times-Bold'\"
- else
- echo shar: Extracting \"'postscript/font/Times-Bold'\" \(62 characters\)
- sed "s/^X//" >'postscript/font/Times-Bold' <<'END_OF_FILE'
- X/Times-Bold (fonts/TIMES/roman.r) lib (font/proforma) lib run
- END_OF_FILE
- if test 62 -ne `wc -c <'postscript/font/Times-Bold'`; then
- echo shar: \"'postscript/font/Times-Bold'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Times-Bold'
- fi
- if test -f 'postscript/font/Times-Italic' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Times-Italic'\"
- else
- echo shar: Extracting \"'postscript/font/Times-Italic'\" \(63 characters\)
- sed "s/^X//" >'postscript/font/Times-Italic' <<'END_OF_FILE'
- X/Times-Italic (fonts/Times/italic) lib (font/proforma) lib run
- END_OF_FILE
- if test 63 -ne `wc -c <'postscript/font/Times-Italic'`; then
- echo shar: \"'postscript/font/Times-Italic'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Times-Italic'
- fi
- if test -f 'postscript/font/Times-Roman' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Times-Roman'\"
- else
- echo shar: Extracting \"'postscript/font/Times-Roman'\" \(61 characters\)
- sed "s/^X//" >'postscript/font/Times-Roman' <<'END_OF_FILE'
- X/Times-Roman (fonts/Times/roman) lib (font/proforma) lib run
- END_OF_FILE
- if test 61 -ne `wc -c <'postscript/font/Times-Roman'`; then
- echo shar: \"'postscript/font/Times-Roman'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Times-Roman'
- fi
- if test -f 'postscript/font/Times-Roman-Adobe' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/Times-Roman-Adobe'\"
- else
- echo shar: Extracting \"'postscript/font/Times-Roman-Adobe'\" \(74 characters\)
- sed "s/^X//" >'postscript/font/Times-Roman-Adobe' <<'END_OF_FILE'
- X/Times-Roman-Adobe (widths/Adobe/Times-Roman) lib (font/proforma) lib run
- END_OF_FILE
- if test 74 -ne `wc -c <'postscript/font/Times-Roman-Adobe'`; then
- echo shar: \"'postscript/font/Times-Roman-Adobe'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/Times-Roman-Adobe'
- fi
- if test -f 'postscript/font/proforma' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/font/proforma'\"
- else
- echo shar: Extracting \"'postscript/font/proforma'\" \(531 characters\)
- sed "s/^X//" >'postscript/font/proforma' <<'END_OF_FILE'
- X% FontName CharFile
- X
- X30 dict begin
- X /CharFile exch def
- X /FontName exch def
- X /FontType 3 def
- X /FontBBox [0.0 -32.0 32.0 32.0] def
- X /FontMatrix [ 1 38.0 div 0 0 -1 32.0 div 0 0] def
- X /Encoding 256 array def
- X StandardEncoding Encoding copy pop
- X /Metrics 256 dict def
- X /CharStrings 256 dict def
- X /BuildChar {
- X 1 index begin
- X FontDirectory FontName get /BuildChar /buildhershey load put
- X currentdict /BuildChar /buildhershey load put
- X CharFile run
- X /BuildChar load
- X end
- X exec
- X } def
- X FontName currentdict definefont pop
- Xend
- END_OF_FILE
- if test 531 -ne `wc -c <'postscript/font/proforma'`; then
- echo shar: \"'postscript/font/proforma'\" unpacked with wrong size!
- fi
- # end of 'postscript/font/proforma'
- fi
- if test ! -d 'postscript/fonts' ; then
- echo shar: Creating directory \"'postscript/fonts'\"
- mkdir 'postscript/fonts'
- fi
- if test ! -d 'postscript/fonts/Gothic' ; then
- echo shar: Creating directory \"'postscript/fonts/Gothic'\"
- mkdir 'postscript/fonts/Gothic'
- fi
- if test ! -d 'postscript/fonts/Olde' ; then
- echo shar: Creating directory \"'postscript/fonts/Olde'\"
- mkdir 'postscript/fonts/Olde'
- fi
- if test ! -d 'postscript/fonts/SANS' ; then
- echo shar: Creating directory \"'postscript/fonts/SANS'\"
- mkdir 'postscript/fonts/SANS'
- fi
- if test ! -d 'postscript/fonts/Sans' ; then
- echo shar: Creating directory \"'postscript/fonts/Sans'\"
- mkdir 'postscript/fonts/Sans'
- fi
- if test ! -d 'postscript/fonts/TIMES' ; then
- echo shar: Creating directory \"'postscript/fonts/TIMES'\"
- mkdir 'postscript/fonts/TIMES'
- fi
- if test ! -d 'postscript/fonts/Times' ; then
- echo shar: Creating directory \"'postscript/fonts/Times'\"
- mkdir 'postscript/fonts/Times'
- fi
- if test -f 'postscript/fonts/Times/italic' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/fonts/Times/italic'\"
- else
- echo shar: Extracting \"'postscript/fonts/Times/italic'\" \(62 characters\)
- sed "s/^X//" >'postscript/fonts/Times/italic' <<'END_OF_FILE'
- X(fonts/Times/italic.r)
- Xlib
- Xrun
- X(fonts/Times/italic.a)
- Xlib
- Xrun
- END_OF_FILE
- if test 62 -ne `wc -c <'postscript/fonts/Times/italic'`; then
- echo shar: \"'postscript/fonts/Times/italic'\" unpacked with wrong size!
- fi
- # end of 'postscript/fonts/Times/italic'
- fi
- if test -f 'postscript/fonts/Times/roman' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/fonts/Times/roman'\"
- else
- echo shar: Extracting \"'postscript/fonts/Times/roman'\" \(60 characters\)
- sed "s/^X//" >'postscript/fonts/Times/roman' <<'END_OF_FILE'
- X(fonts/Times/roman.r)
- Xlib
- Xrun
- X(fonts/Times/roman.a)
- Xlib
- Xrun
- END_OF_FILE
- if test 60 -ne `wc -c <'postscript/fonts/Times/roman'`; then
- echo shar: \"'postscript/fonts/Times/roman'\" unpacked with wrong size!
- fi
- # end of 'postscript/fonts/Times/roman'
- fi
- if test ! -d 'postscript/fonts/extra' ; then
- echo shar: Creating directory \"'postscript/fonts/extra'\"
- mkdir 'postscript/fonts/extra'
- fi
- if test ! -d 'postscript/fonts/sans' ; then
- echo shar: Creating directory \"'postscript/fonts/sans'\"
- mkdir 'postscript/fonts/sans'
- fi
- if test -f 'postscript/fonts/sans/greek.r' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'postscript/fonts/sans/greek.r'\"
- else
- echo shar: Extracting \"'postscript/fonts/sans/greek.r'\" \(2045 characters\)
- sed "s/^X//" >'postscript/fonts/sans/greek.r' <<'END_OF_FILE'
- XCharStrings
- X/27
- X<C53B
- X4144
- XC53B
- X4944
- XC341
- X4741
- X>
- Xput
- XMetrics
- X/27
- X[0
- X10]
- Xput
- XCharStrings
- X/28
- X<C23B
- X4244
- XC23B
- X463B
- X483C
- X483E
- X463F
- XC23F
- X463F
- X4840
- X4843
- X4644
- X4244
- X>
- Xput
- XMetrics
- X/28
- X[0
- X10]
- Xput
- XCharStrings
- X/29
- X<C23B
- X4244
- XC23B
- X483B
- X>
- Xput
- XMetrics
- X/29
- X[0
- X9]
- Xput
- XCharStrings
- X/30
- X<C53B
- X4144
- XC53B
- X4944
- XC144
- X4944
- X>
- Xput
- XMetrics
- X/30
- X[0
- X10]
- Xput
- XCharStrings
- X/31
- X<C23B
- X4244
- XC23B
- X483B
- XC23F
- X463F
- XC244
- X4844
- X>
- Xput
- XMetrics
- X/31
- X[0
- X10]
- Xput
- XCharStrings
- X/32
- X<C83B
- X4244
- XC23B
- X483B
- XC244
- X4844
- X>
- Xput
- XMetrics
- X/32
- X[0
- X10]
- Xput
- XCharStrings
- X/33
- X<C23B
- X4244
- XC83B
- X4844
- XC23F
- X483F
- X>
- Xput
- XMetrics
- X/33
- X[0
- X10]
- Xput
- XCharStrings
- X/34
- X<C53B
- X433C
- X423E
- X4241
- X4343
- X4544
- X4644
- X4843
- X4941
- X493E
- X483C
- X463B
- X453B
- XC43F
- X4740
- XC73F
- X4440
- X>
- Xput
- XMetrics
- X/34
- X[0
- X11]
- Xput
- XCharStrings
- X/35
- X<C23B
- X4244
- X>
- Xput
- XMetrics
- X/35
- X[3
- X4]
- Xput
- XCharStrings
- X/36
- X<C23B
- X4244
- XC83B
- X4241
- XC43F
- X4844
- X>
- Xput
- XMetrics
- X/36
- X[0
- X10]
- Xput
- XCharStrings
- X/37
- X<C53B
- X4144
- XC53B
- X4944
- X>
- Xput
- XMetrics
- X/37
- X[0
- X10]
- Xput
- XCharStrings
- X/38
- X<C23B
- X4244
- XC23B
- X4644
- XCA3B
- X4644
- XCA3B
- X4A44
- X>
- Xput
- XMetrics
- X/38
- X[-1
- X12]
- Xput
- XCharStrings
- X/39
- X<C23B
- X4244
- XC23B
- X4844
- XC83B
- X4844
- X>
- Xput
- XMetrics
- X/39
- X[0
- X10]
- Xput
- XCharStrings
- X/40
- X<C23B
- X483B
- XC33F
- X4740
- XC73F
- X4340
- XC244
- X4844
- X>
- Xput
- XMetrics
- X/40
- X[0
- X10]
- Xput
- XCharStrings
- X/41
- X<C53B
- X433C
- X423E
- X4241
- X4343
- X4544
- X4644
- X4843
- X4941
- X493E
- X483C
- X463B
- X453B
- X>
- Xput
- XMetrics
- X/41
- X[0
- X11]
- Xput
- XCharStrings
- X/42
- X<C23B
- X4244
- XC83B
- X4844
- XC23B
- X483B
- X>
- Xput
- XMetrics
- X/42
- X[0
- X10]
- Xput
- XCharStrings
- X/43
- X<C23B
- X4244
- XC23B
- X463B
- X483C
- X483F
- X4640
- X4240
- X>
- Xput
- XMetrics
- X/43
- X[0
- X10]
- Xput
- XCharStrings
- X/44
- X<C23B
- X453F
- X4244
- XC23B
- X483B
- XC244
- X4844
- X>
- Xput
- XMetrics
- X/44
- X[0
- X10]
- Xput
- XCharStrings
- X/45
- X<C53B
- X4544
- XC13B
- X493B
- X>
- Xput
- XMetrics
- X/45
- X[0
- X10]
- Xput
- XCharStrings
- X/46
- X<C13D
- X413C
- X423B
- X433B
- X443C
- X453E
- X4544
- XC93D
- X493C
- X483B
- X473B
- X463C
- X453E
- X>
- Xput
- XMetrics
- X/46
- X[0
- X10]
- Xput
- XCharStrings
- X/47
- X<C63B
- X4644
- XC43D
- X423E
- X4241
- X4442
- X4842
- X4A41
- X4A3E
- X483D
- X443D
- X>
- Xput
- XMetrics
- X/47
- X[-1
- X12]
- Xput
- XCharStrings
- X/48
- X<C23B
- X4844
- XC83B
- X4244
- X>
- Xput
- XMetrics
- X/48
- X[0
- X10]
- Xput
- XCharStrings
- X/49
- X<C63B
- X4644
- XC23D
- X433E
- X4341
- X4542
- X4742
- X4941
- X493E
- X4A3D
- X>
- Xput
- XMetrics
- X/49
- X[-1
- X12]
- Xput
- XCharStrings
- X/50
- X<C244
- X4444
- X4240
- X423E
- X433C
- X453B
- X463B
- X483C
- X493E
- X4940
- X4744
- X4944
- X>
- Xput
- XMetrics
- X/50
- X[0
- X11]
- Xput
- END_OF_FILE
- if test 2045 -ne `wc -c <'postscript/fonts/sans/greek.r'`; then
- echo shar: \"'postscript/fonts/sans/greek.r'\" unpacked with wrong size!
- fi
- # end of 'postscript/fonts/sans/greek.r'
- fi
- if test ! -d 'postscript/fonts/times' ; then
- echo shar: Creating directory \"'postscript/fonts/times'\"
- mkdir 'postscript/fonts/times'
- fi
- if test ! -d 'postscript/widths' ; then
- echo shar: Creating directory \"'postscript/widths'\"
- mkdir 'postscript/widths'
- fi
- if test ! -d 'postscript/widths/Adobe' ; then
- echo shar: Creating directory \"'postscript/widths/Adobe'\"
- mkdir 'postscript/widths/Adobe'
- fi
- if test ! -d 'source' ; then
- echo shar: Creating directory \"'source'\"
- mkdir 'source'
- fi
- if test -f 'source/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/README'\"
- else
- echo shar: Extracting \"'source/README'\" \(839 characters\)
- sed "s/^X//" >'source/README' <<'END_OF_FILE'
- XThis is a virtually complete implementation of PostScript. Just type
- Xmake and it should produce a version for suns. Since the only complete
- Xdriver is for suns and since some driver writing will be necessary on
- Xany other machine, I have not packaged everything up in an idiot-proof
- Xbox. I am not aware of any Gotchas in building this source. The X
- Xdriver used to work on X10 - It will need work for X11. The pixrect
- Xdriver is very new, and should be regarded as didactic, as it scribbles
- Xstraight onto the display. Persuading suntools to look after the bits
- Xwould have taken too long.
- X
- XWriting your own driver involves merely hacking pixrect.c until it will
- Xdrive your display. There are only 11 routines to write, and they're
- Xall quite short.
- X
- XHave fun!
- X
- X- Crispin Goswell
- X
- Xcaag@uk.ac.rl.vd
- Xcaag@vd.rl.ac.uk
- X...!mcvax!ukc!rlvd!caag
- END_OF_FILE
- if test 839 -ne `wc -c <'source/README'`; then
- echo shar: \"'source/README'\" unpacked with wrong size!
- fi
- # end of 'source/README'
- fi
- if test -f 'source/canon.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/canon.c'\"
- else
- echo shar: Extracting \"'source/canon.c'\" \(1318 characters\)
- sed "s/^X//" >'source/canon.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- X#include "main.h"
- X#include "graphics.h"
- X#include "canon.h"
- X
- Xint pixels_per_inch;
- X
- Xint single_rop [] =
- X {
- X ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE,
- X ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE,
- X ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE,
- X ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE
- X };
- X
- X/*ARGSUSED*/
- XMatrix DeviceMatrix (width, height) int width, height;
- X {
- X return NewMatrix (pixels_per_inch / 72.0, 0.0, 0.0, -pixels_per_inch / 72.0, 0.0, (float) height);
- X }
- X
- Xvoid HardUpdate ()
- X {
- X }
- X
- Xint IsWindowHardware (h) struct hardware *h;
- X {
- X return h->flags & ISWIN;
- X }
- X
- X#define IsWindowHardware(h) ((h)->flags & ISWIN)
- X
- XDevicePoint HardwareExtent (h) struct hardware *h;
- X {
- X if (h)
- X return h->extent;
- X else
- X return NewDevicePoint (0, 0);
- X }
- X
- Xvoid SetClipHardware (h, clip) struct hardware *h, *clip;
- X {
- X if (h)
- X h->clip = clip;
- X }
- END_OF_FILE
- if test 1318 -ne `wc -c <'source/canon.c'`; then
- echo shar: \"'source/canon.c'\" unpacked with wrong size!
- fi
- # end of 'source/canon.c'
- fi
- if test -f 'source/canon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/canon.h'\"
- else
- echo shar: Extracting \"'source/canon.h'\" \(351 characters\)
- sed "s/^X//" >'source/canon.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#define ISWIN 1
- X
- Xstruct hardware
- X {
- X union hard {
- X char *addr;
- X int handle;
- X } hard;
- X int flags;
- X DevicePoint extent;
- X struct hardware *aux, *clip;
- X };
- X
- Xextern void InitTransfer ();
- Xextern int pixels_per_inch;
- X
- Xextern int single_rop[];
- X
- Xextern struct hardware *GraySync ();
- END_OF_FILE
- if test 351 -ne `wc -c <'source/canon.h'`; then
- echo shar: \"'source/canon.h'\" unpacked with wrong size!
- fi
- # end of 'source/canon.h'
- fi
- if test -f 'source/colour.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/colour.h'\"
- else
- echo shar: Extracting \"'source/colour.h'\" \(311 characters\)
- sed "s/^X//" >'source/colour.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- Xtypedef struct { float hue, saturation, brightness; } Colour;
- X
- Xextern Colour Black, White;
- X
- Xextern Colour NewColour (), NewHSBColour (), NewRGBColour (), NewGray ();
- Xextern void ColourHSB (), ColourRGB ();
- Xextern float Gray (), Brightness ();
- END_OF_FILE
- if test 311 -ne `wc -c <'source/colour.h'`; then
- echo shar: \"'source/colour.h'\" unpacked with wrong size!
- fi
- # end of 'source/colour.h'
- fi
- if test -f 'source/copyright.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/copyright.h'\"
- else
- echo shar: Extracting \"'source/copyright.h'\" \(479 characters\)
- sed "s/^X//" >'source/copyright.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- END_OF_FILE
- if test 479 -ne `wc -c <'source/copyright.h'`; then
- echo shar: \"'source/copyright.h'\" unpacked with wrong size!
- fi
- # end of 'source/copyright.h'
- fi
- if test -f 'source/device.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/device.h'\"
- else
- echo shar: Extracting \"'source/device.h'\" \(345 characters\)
- sed "s/^X//" >'source/device.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#include "hard.h"
- X
- Xstruct device
- X {
- X Matrix default_matrix;
- X Path default_clip;
- X int link_count;
- X struct hardware *dev;
- X };
- X
- Xextern struct device *NewDevice (), *NewCacheDevice (), *LinkDevice (), *DeviceFrom (), *UniqueDevice ();
- Xextern struct device *NewBitmapDevice ();
- END_OF_FILE
- if test 345 -ne `wc -c <'source/device.h'`; then
- echo shar: \"'source/device.h'\" unpacked with wrong size!
- fi
- # end of 'source/device.h'
- fi
- if test -f 'source/font.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/font.h'\"
- else
- echo shar: Extracting \"'source/font.h'\" \(190 characters\)
- sed "s/^X//" >'source/font.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X
- Xextern Object Fid, FD, FontMatrix, FontType, Encoding, FontBBox, FontName;
- Xextern Object UserShow, CharStrings, Metrics;
- END_OF_FILE
- if test 190 -ne `wc -c <'source/font.h'`; then
- echo shar: \"'source/font.h'\" unpacked with wrong size!
- fi
- # end of 'source/font.h'
- fi
- if test -f 'source/graphics.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/graphics.h'\"
- else
- echo shar: Extracting \"'source/graphics.h'\" \(1047 characters\)
- sed "s/^X//" >'source/graphics.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#include "device.h"
- X#include "point.h"
- X#include "font.h"
- X
- X#define PI 3.14159265358979
- X
- X#define MAXDASH 11
- X
- X#define MAXGSAVES 20
- X
- X#define BBOX_LEFT 0
- X#define BBOX_TOP 1
- X#define BBOX_RIGHT 2
- X#define BBOX_BOTTOM 3
- X
- Xstruct show_context
- X {
- X char InShow;
- X char space;
- X Point Width;
- X HardPoint shim, space_shim;
- X Object CharName;
- X struct cache *ccache;
- X Matrix mat;
- X };
- X
- Xstruct state
- X {
- X Matrix CTM;
- X Colour colour;
- X HardPoint cp; int cp_defined;
- X Path path;
- X Path clip;
- X Object font;
- X float line_width;
- X int line_cap;
- X int line_join;
- X struct
- X {
- X float frequency, rotation, *thresh;
- X int count;
- X Object spot_function;
- X } screen;
- X struct {
- X Object transfn;
- X float *tran;
- X int tcount;
- X } transfer;
- X int flatness;
- X float miter_limit;
- X float dash_offset, dash_array [MAXDASH];
- X int dash_length;
- X struct device *device;
- X struct show_context *show;
- X struct device *clipdevice;
- X };
- X
- Xextern struct state *gstate;
- X
- Xextern int stroke_method, fill_method;
- END_OF_FILE
- if test 1047 -ne `wc -c <'source/graphics.h'`; then
- echo shar: \"'source/graphics.h'\" unpacked with wrong size!
- fi
- # end of 'source/graphics.h'
- fi
- if test -f 'source/hard.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/hard.h'\"
- else
- echo shar: Extracting \"'source/hard.h'\" \(821 characters\)
- sed "s/^X//" >'source/hard.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#include "mat.h"
- X#include "rop.h"
- X#include "colour.h"
- X#include "path.h"
- X
- Xtypedef struct device_point { int dx, dy; } DevicePoint;
- X
- Xextern struct hardware *HardwareFromString (), *NewBitmapHardware (), *NewWindowHardware (), *InitHardware ();
- Xextern DevicePoint HardwareExtent ();
- Xextern char *StringFromHardware ();
- X
- Xextern void BitBlt (), BitBltBlob (), BitBltLine (), DestroyHardware ();
- Xextern void HardUpdate (), UpdateControl ();
- Xextern Matrix DeviceMatrix ();
- X
- Xextern void RasterTile (), BitBltTrapezoid ();
- X
- Xextern int IsWindowHardware (), TransferSize ();
- Xextern void SetTransfer ();
- Xextern void Paint (), PaintLine (), PaintTrapezoid ();
- Xextern int ScreenSize ();
- Xextern void BuildScreen (), SetScreen ();
- Xextern DevicePoint NewDevicePoint ();
- END_OF_FILE
- if test 821 -ne `wc -c <'source/hard.h'`; then
- echo shar: \"'source/hard.h'\" unpacked with wrong size!
- fi
- # end of 'source/hard.h'
- fi
- if test -f 'source/head' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/head'\"
- else
- echo shar: Extracting \"'source/head'\" \(68 characters\)
- sed "s/^X//" >'source/head' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- END_OF_FILE
- if test 68 -ne `wc -c <'source/head'`; then
- echo shar: \"'source/head'\" unpacked with wrong size!
- fi
- # end of 'source/head'
- fi
- if test -f 'source/head.ed' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/head.ed'\"
- else
- echo shar: Extracting \"'source/head.ed'\" \(77 characters\)
- sed "s/^X//" >'source/head.ed' <<'END_OF_FILE'
- X1i
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X.
- Xw
- Xq
- END_OF_FILE
- if test 77 -ne `wc -c <'source/head.ed'`; then
- echo shar: \"'source/head.ed'\" unpacked with wrong size!
- fi
- # end of 'source/head.ed'
- fi
- if test -f 'source/makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/makefile'\"
- else
- echo shar: Extracting \"'source/makefile'\" \(1696 characters\)
- sed "s/^X//" >'source/makefile' <<'END_OF_FILE'
- XOBJECTS=array.o boolean.o config.o control.o dictionary.o file.o\
- X integer.o main.o math.o misc.o name.o operator.o\
- X poly.o property.o real.o save.o stack.o string.o unix.o
- XLIBS=libww.a -lsuntool -lsunwindow -lpixrect -g
- XGRAPHICS=cache.o colour.o device.o fill.o font.o gsave.o image.o mat.o matrix.o\
- X pat.o path.o state.o stroke.o
- XCFLAGS=-O
- X
- XPS: $(OBJECTS) $(GRAPHICS) hard.o canon.a
- X cc $(CFLAGS) $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm `libs` -o PS
- X
- XsunPS: $(OBJECTS) $(GRAPHICS) hard.o canon.a pixrect
- X cc $(CFLAGS) $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm -lpixrect -o sunPS
- X
- XCPS: $(OBJECTS) $(GRAPHICS) colour-ww.o trapezoid.o canon.o
- X cc $(CFLAGS) $(OBJECTS) $(GRAPHICS) colour-ww.o canon.o trapezoid.o -lm `libs` -o CPS
- X
- Xpostscript: $(OBJECTS) $(GRAPHICS) adapter.o protocol.o
- X cc $(CFLAGS) $(OBJECTS) $(GRAPHICS) adapter.o protocol.o -lm -o postscript
- X
- XXPS: $(OBJECTS) $(GRAPHICS) X.o
- X cc $(CFLAGS) $(OBJECTS) $(GRAPHICS) X.o -lm -lX -o XPS
- X
- Xcanon.a: canon.o screen.o trapezoid.o paint.o
- X ar ruv canon.a canon.o screen.o trapezoid.o paint.o
- X ranlib canon.a
- X
- Xviewer: protocol.o viewer.o hard.o canon.a
- X cc protocol.o viewer.o hard.o canon.a `libs` -o viewer
- X
- Xall: PS postscript viewer
- X
- Xww: ww.o wwlib installww
- X
- Xpixrect: pixrect.o
- X cp pixrect.o hard.o
- X
- Xsun: ww wwsun
- X
- Xorion: orion.o installorion orionlib
- X
- XX.o:
- X cc -c X.c
- X
- Xwwlib:
- X if [ -f libww.a ]; \
- X then \
- X echo 'echo libww.a' >lww; \
- X else \
- X echo 'echo -lww' >lww; \
- X fi; \
- X chmod +x lww
- X echo "echo `lww`" >libs; chmod +x libs
- X
- Xwwsun:
- X echo "echo `lww` -lsuntool -lsunwindow -lpixrect" >libs; chmod +x libs
- X
- Xorionlib:
- X echo 'echo -lG' >libs; chmod +x libs
- X
- Xinstallww:
- X cp ww.o hard.o
- X
- Xinstallorion:
- X cp orion.o hard.o
- END_OF_FILE
- if test 1696 -ne `wc -c <'source/makefile'`; then
- echo shar: \"'source/makefile'\" unpacked with wrong size!
- fi
- # end of 'source/makefile'
- fi
- if test -f 'source/malloc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/malloc.c'\"
- else
- echo shar: Extracting \"'source/malloc.c'\" \(1317 characters\)
- sed "s/^X//" >'source/malloc.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- X#define THRESHOLD 4096
- X#define NULL 0
- X
- Xstatic char *FreeSpace = NULL, *sbrk ();
- Xstatic int Left = 0;
- X
- Xchar *malloc (size) unsigned size;
- X {
- X char *res;
- X
- X if (FreeSpace == NULL)
- X FreeSpace = sbrk (0);
- X
- X size = (size + 3) & ~3;
- X res = FreeSpace;
- X if (size > Left)
- X {
- X int chunk;
- X
- X if (sbrk (chunk = size > THRESHOLD ? size : THRESHOLD) == (char *) -1)
- X return NULL;
- X Left += chunk;
- X }
- X Left -= size;
- X FreeSpace += size;
- X
- X return res;
- X }
- X
- Xint free (block) char *block;
- X {
- X }
- X
- Xchar *realloc (b, size) char *b; unsigned size;
- X {
- X char *block = malloc (size);
- X
- X while (--size > 0)
- X *block++ = *b++;
- X return block;
- X }
- X
- Xchar *calloc (size1, size2) unsigned size1, size2;
- X {
- X unsigned total = size1 * size2;
- X char *res = malloc (total), *p = res;
- X
- X while (--total > 0)
- X *p++ = 0;
- X return res;
- X }
- END_OF_FILE
- if test 1317 -ne `wc -c <'source/malloc.c'`; then
- echo shar: \"'source/malloc.c'\" unpacked with wrong size!
- fi
- # end of 'source/malloc.c'
- fi
- if test -f 'source/mat.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/mat.h'\"
- else
- echo shar: Extracting \"'source/mat.h'\" \(388 characters\)
- sed "s/^X//" >'source/mat.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- Xtypedef struct matrix { float A, B, C, D, tx, ty; } Matrix;
- X
- Xtypedef struct vector { float vx, vy, vt; } Vector;
- X
- Xextern Matrix NewMatrix (), MatMult (), MatInvert (), Translate (), Rotate (), Scale ();
- Xextern Vector NewVector (), DiffVector ();
- Xextern Vector Transform (), ITransform (), DTransform (), IDTransform ();
- END_OF_FILE
- if test 388 -ne `wc -c <'source/mat.h'`; then
- echo shar: \"'source/mat.h'\" unpacked with wrong size!
- fi
- # end of 'source/mat.h'
- fi
- if test -f 'source/misc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/misc.c'\"
- else
- echo shar: Extracting \"'source/misc.c'\" \(886 characters\)
- sed "s/^X//" >'source/misc.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- X#include "main.h"
- X#include <sys/param.h>
- X#include <sys/times.h>
- X#ifndef HZ
- X# define HZ 60
- X#endif
- X
- Xstatic int PUserTime ();
- X
- XInitMisc ()
- X {
- X InstallOp ("usertime", PUserTime, 0, 1, 0, 0);
- X InstallOp ("==", PolyFirst, 1, 1, 0, 0, Poly);
- X }
- X
- Xstatic int PUserTime ()
- X {
- X struct tms tbuf;
- X long times ();
- X
- X times (&tbuf);
- X return Push (OpStack, MakeInteger ((int) (tbuf.tms_utime * 1000 / HZ)));
- X }
- END_OF_FILE
- if test 886 -ne `wc -c <'source/misc.c'`; then
- echo shar: \"'source/misc.c'\" unpacked with wrong size!
- fi
- # end of 'source/misc.c'
- fi
- if test -f 'source/null.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/null.c'\"
- else
- echo shar: Extracting \"'source/null.c'\" \(2261 characters\)
- sed "s/^X//" >'source/null.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- X#include "main.h"
- X#include "graphics.h"
- X#include "canon.h"
- X
- Xstruct hardware *InitHardware ()
- X {
- X InitTransfer (1);
- X
- X return NULL;
- X }
- X
- Xstatic struct hardware *NewHardware (bits, width, height, flags) char *bits; int width, height, flags;
- X {
- X struct hardware *d = (struct hardware *) Malloc (sizeof (struct hardware));
- X
- X d->hard.addr = bits;
- X d->flags = flags;
- X d->aux = d->clip = NULL;
- X d->extent = NewDevicePoint (width, height);
- X
- X return d;
- X }
- X
- Xstruct hardware *NewWindowHardware (width, height) int width, height;
- X {
- X return NewHardware (NULL, width, height, ISWIN);
- X }
- X
- Xstruct hardware *NewBitmapHardware (width, height) int width, height;
- X {
- X return NewHardware (NULL, width, height, 0);
- X }
- X
- Xstatic void DestroyBits (b) char *b;
- X {
- X }
- X
- Xvoid DestroyHardware (dev) struct hardware *dev;
- X {
- X if (dev == NULL)
- X return;
- X DestroyBits (dev->hard.addr);
- X if (dev->aux)
- X DestroyHardware (dev->aux);
- X Free ((char *) dev);
- X }
- X
- Xstruct hardware *HardwareFromString (st, width, height) char *st; int width, height;
- X {
- X Free (st);
- X return NewHardware (NULL, width, height, 0);
- X }
- X
- Xchar *StringFromHardware (dev) struct hardware *dev;
- X {
- X return Malloc ((dev->extent.dx + 7) / 8 *dev->extent.dy);
- X }
- X
- Xvoid UpdateControl (h, flag) struct hardware *h; int flag;
- X {
- X }
- X
- Xvoid RasterTile (from, to, toPoint, extent, rop)
- X struct hardware *from, *to;
- X DevicePoint toPoint, extent;
- X int rop;
- X {
- X }
- X
- Xvoid BitBlt (from, to, fromPoint, toPoint, extent, rop)
- X struct hardware *from, *to;
- X DevicePoint fromPoint, toPoint, extent;
- X int rop;
- X {
- X }
- X
- Xvoid BitBltLine (h, fromPoint, toPoint, rop)
- X struct hardware *h;
- X DevicePoint fromPoint, toPoint;
- X int rop;
- X {
- X }
- X
- Xvoid BitBltBlob (to, top, height, left, right, rop) struct hardware *to; int top, height, *left, *right, rop;
- X {
- X }
- END_OF_FILE
- if test 2261 -ne `wc -c <'source/null.c'`; then
- echo shar: \"'source/null.c'\" unpacked with wrong size!
- fi
- # end of 'source/null.c'
- fi
- if test -f 'source/path.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/path.h'\"
- else
- echo shar: Extracting \"'source/path.h'\" \(1008 characters\)
- sed "s/^X//" >'source/path.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#define CBUTT 0
- X#define CROUND 1
- X#define CSQUARE 2
- X
- X#define JMITRE 0
- X#define JROUND 1
- X#define JBEVEL 2
- X
- X#define STROKE_FILL 0
- X#define STROKE_THIN 1
- X
- X#define FILL_SINGLE 0
- X#define FILL_CACHE_DOUBLE 1
- X#define FILL_DOUBLE 2
- X#define FILL_DOUBLE_STROKE 3
- X
- Xtypedef struct hard_point { float hx, hy; } HardPoint;
- X
- Xenum pelem_type { EHeader, EMove, ELine, EArc, ECurve, EClose };
- X
- Xstruct path_element
- X {
- X enum pelem_type ptype;
- X union {
- X HardPoint point;
- X struct arc { int dir; HardPoint centre; float radius, from, to; } arc;
- X struct bezier { HardPoint x0, x1, x2; } curve;
- X } pe;
- X struct path_element *next, *last;
- X };
- X
- Xtypedef struct path_element *Path;
- X
- Xextern HardPoint NewHardPoint (), ExtToInt (), MoveHardPoint ();
- Xextern Path NewPath (), PathCopy (), NewMove ();
- Xextern int PNewPath (), PInitMatrix ();
- Xextern Path NewClipPath (), PathRemove (), ReversePath (), FlattenPath ();
- Xextern float Normalise (), PointX (), PointY ();
- END_OF_FILE
- if test 1008 -ne `wc -c <'source/path.h'`; then
- echo shar: \"'source/path.h'\" unpacked with wrong size!
- fi
- # end of 'source/path.h'
- fi
- if test -f 'source/point.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/point.h'\"
- else
- echo shar: Extracting \"'source/point.h'\" \(263 characters\)
- sed "s/^X//" >'source/point.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- Xtypedef struct point { float x, y; } Point;
- X
- Xextern Matrix PointTranslate ();
- Xextern Point NewPoint (), IntToExt (), MovePoint ();
- Xextern int MoveTo (), LineTo ();
- Xextern Object AssignMatrix ();
- END_OF_FILE
- if test 263 -ne `wc -c <'source/point.h'`; then
- echo shar: \"'source/point.h'\" unpacked with wrong size!
- fi
- # end of 'source/point.h'
- fi
- if test -f 'source/protocol.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/protocol.h'\"
- else
- echo shar: Extracting \"'source/protocol.h'\" \(954 characters\)
- sed "s/^X//" >'source/protocol.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#define NEW_WINDOW 'W'
- X#define NEW_BITMAP 'B'
- X#define BITBLT 'b'
- X#define SEND_BITMAP 's'
- X#define GET_BITMAP 'g'
- X#define DESTROY_HARDWARE 'D'
- X#define LINE 'l'
- X#define GET_MATRIX 'm'
- X#define GET_TRANSFERSIZE 't'
- X#define SET_TRANSFER 'T'
- X#define PAINT 'P'
- X#define PAINT_LINE 'L'
- X#define HARD_FLUSH 'F'
- X#define SCREEN_SIZE 'Z'
- X#define BUILD_SCREEN 'U'
- X#define SET_SCREEN 'S'
- X#define SET_CLIP_HARDWARE 'c'
- X#define BITBLT_TRAPEZOID 'r'
- X#define PAINT_TRAPEZOID 'R'
- X#define SET_UPDATE_CONTROL 'u'
- X
- Xvoid master_protocol ();
- Xvoid slave_protocol ();
- Xvoid send_colour ();
- XColour recv_colour ();
- Xvoid send_small ();
- Xfloat recv_small ();
- Xvoid send_point ();
- XDevicePoint recv_point ();
- Xvoid send_byte ();
- Xunsigned char recv_byte ();
- Xvoid send_short ();
- Xshort recv_short ();
- Xvoid send_float ();
- Xfloat recv_float ();
- Xvoid send_string ();
- Xvoid recv_string ();
- Xvoid flush_protocol ();
- Xint can_recv ();
- END_OF_FILE
- if test 954 -ne `wc -c <'source/protocol.h'`; then
- echo shar: \"'source/protocol.h'\" unpacked with wrong size!
- fi
- # end of 'source/protocol.h'
- fi
- if test -f 'source/rop.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/rop.h'\"
- else
- echo shar: Extracting \"'source/rop.h'\" \(583 characters\)
- sed "s/^X//" >'source/rop.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- X#define ROP_FALSE 0 /* F */
- X#define ROP_AND 1 /* S & D */
- X#define ROP_ANDNOT 2 /* S & ~D */
- X#define ROP_SOURCE 3 /* S */
- X#define ROP_NOTAND 4 /* ~S & D */
- X#define ROP_DEST 5 /* D */
- X#define ROP_XOR 6 /* S ^ D */
- X#define ROP_OR 7 /* S | D */
- X#define ROP_NOR 8 /* ~(S | D) */
- X#define ROP_NXOR 9 /* ~(S ^ D) */
- X#define ROP_NOTDEST 10 /* ~D */
- X#define ROP_ORNOT 11 /* S | ~D */
- X#define ROP_NOTSOURCE 12 /* ~S */
- X#define ROP_NOTOR 13 /* ~S | D */
- X#define ROP_NAND 14 /* ~(S & D) */
- X#define ROP_TRUE 15 /* T */
- END_OF_FILE
- if test 583 -ne `wc -c <'source/rop.h'`; then
- echo shar: \"'source/rop.h'\" unpacked with wrong size!
- fi
- # end of 'source/rop.h'
- fi
- if test -f 'source/save.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/save.c'\"
- else
- echo shar: Extracting \"'source/save.c'\" \(966 characters\)
- sed "s/^X//" >'source/save.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- X#include "main.h"
- X
- X#define SMALL_SIZE 4096
- X
- Xstatic char *small_buf;
- Xstatic int left = 0;
- X
- Xchar *Malloc (u) unsigned u;
- X {
- X char *malloc (), *res;
- X
- X if (0/*u < SMALL_SIZE*/)
- X {
- X char *res;
- X if (left < u)
- X {
- X small_buf = Malloc (SMALL_SIZE);
- X left = SMALL_SIZE;
- X }
- X res = small_buf;
- X small_buf += u;
- X left -= u;
- X
- X return res;
- X }
- X
- X PanicIf ((res = malloc (u)) == NULL, "malloc failed");
- X return res;
- X }
- X
- XFree (s) char *s;
- X {
- X /* free (s); */
- X }
- END_OF_FILE
- if test 966 -ne `wc -c <'source/save.c'`; then
- echo shar: \"'source/save.c'\" unpacked with wrong size!
- fi
- # end of 'source/save.c'
- fi
- if test -f 'source/str.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/str.h'\"
- else
- echo shar: Extracting \"'source/str.h'\" \(159 characters\)
- sed "s/^X//" >'source/str.h' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
- X */
- X
- Xchar *strcat (), *strncat ();
- Xint strcmp (), strncmp (), strlen (), strspn (), strcspn ();
- END_OF_FILE
- if test 159 -ne `wc -c <'source/str.h'`; then
- echo shar: \"'source/str.h'\" unpacked with wrong size!
- fi
- # end of 'source/str.h'
- fi
- if test -f 'source/trapezoid.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'source/trapezoid.c'\"
- else
- echo shar: Extracting \"'source/trapezoid.c'\" \(1924 characters\)
- sed "s/^X//" >'source/trapezoid.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) Rutherford Appleton Laboratory 1987
- X *
- X * This source may be copied, distributed, altered or used, but not sold for profit
- X * or incorporated into a product except under licence from the author.
- X * It is not in the public domain.
- X * This notice should remain in the source unaltered, and any changes to the source
- X * made by persons other than the author should be marked as such.
- X *
- X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
- X */
- X#include "main.h"
- X#include "graphics.h"
- X#include "canon.h"
- X
- Xstatic int Xvalue (ax, ay, bx, by, cy) int ax, ay, bx, by, cy;
- X {
- X return bx + (cy - by) * (ax - bx) / (float) (ay - by);
- X }
- X
- Xvoid BitBltTrapezoid (to, lefttop, leftbottom, righttop, rightbottom, top, bottom, rop)
- X struct hardware *to;
- X DevicePoint lefttop, leftbottom, righttop, rightbottom;
- X int top, bottom, rop;
- X {
- X int i, j, temp;
- X static int left [1024], right [1024];
- X
- X int ltx = Xvalue (lefttop.dx, lefttop.dy, leftbottom.dx, leftbottom.dy, top),
- X rtx = Xvalue (righttop.dx, righttop.dy, rightbottom.dx, rightbottom.dy, top),
- X lbx = Xvalue (lefttop.dx, lefttop.dy, leftbottom.dx, leftbottom.dy, bottom),
- X rbx = Xvalue (righttop.dx, righttop.dy, rightbottom.dx, rightbottom.dy, bottom);
- X
- X if (ltx == lbx && rtx == rbx)
- X {
- X if (rtx < ltx)
- X temp = rtx, rtx = ltx, ltx = temp;
- X
- X BitBlt ((struct hardware *) NULL, to,
- X NewDevicePoint (0, 0), NewDevicePoint (ltx, top),
- X NewDevicePoint (rtx - ltx + 1, bottom - top + 1), rop);
- X
- X return;
- X }
- X
- X for (i = top, j = 0; i <= bottom; i++, j++)
- X {
- X int lx = Xvalue (lefttop.dx, lefttop.dy, leftbottom.dx, leftbottom.dy, i),
- X rx = Xvalue (righttop.dx, righttop.dy, rightbottom.dx,rightbottom.dy, i);
- X
- X if (rx < lx)
- X temp = rx, rx = lx, lx = temp;
- X
- X left [j] = lx; right [j] = rx;
- X }
- X BitBltBlob (to, top, bottom - top, left, right, single_rop [rop]);
- X }
- END_OF_FILE
- if test 1924 -ne `wc -c <'source/trapezoid.c'`; then
- echo shar: \"'source/trapezoid.c'\" unpacked with wrong size!
- fi
- # end of 'source/trapezoid.c'
- fi
- echo shar: End of archive 1 \(of 18\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 18 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-